
package com.hulk.ratel.common.util;

import cn.hutool.core.lang.Console;
import cn.hutool.core.util.RandomUtil;
import lombok.AccessLevel;
import lombok.Value;
import lombok.experimental.FieldDefaults;
import lombok.experimental.UtilityClass;


/**
 * @author hulk
 */
@UtilityClass
@Value
@FieldDefaults(level = AccessLevel.PRIVATE)
public class SaltGenerator {

    public static int DEFAULT_LENGTH = 16;


    public static String generateSalt() {

        return generateSalt(DEFAULT_LENGTH);
    }


    public static String generateSalt(final int len) {
        return RandomUtil.randomString(len);
    }


    public static void main(String[] args) {
        Console.log(SaltGenerator.generateSalt());
    }

}
